home *** CD-ROM | disk | FTP | other *** search
/ MacFormat España 4 / MacFormat n. 4 (Spain) / MacFormat 4.bin / La ciudad del ShareWare / Desarrollo / OutOfPhase1.1 Source / OutOfPhase Folder / LFOGenerator.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-01-04  |  2.6 KB  |  80 lines

  1. /* LFOGenerator.h */
  2.  
  3. #ifndef Included_LFOGenerator_h
  4. #define Included_LFOGenerator_h
  5.  
  6. /* LFOGenerator module depends on */
  7. /* MiscInfo.h */
  8. /* Audit */
  9. /* Debug */
  10. /* Definitions */
  11. /* Memory */
  12. /* EnvelopeState */
  13. /* FastFixedPoint */
  14. /* LFOSpecifier */
  15. /* LFOListSpecifier */
  16. /* FloatingPoint */
  17. /* RandomNumbers */
  18. /* Frequency */
  19. /* Multisampler */
  20. /* 64BitMath */
  21. /* SampleConsts */
  22. /* WaveIndexUtility */
  23.  
  24. #include "FastFixedPoint.h"
  25.  
  26. struct LFOGenRec;
  27. typedef struct LFOGenRec LFOGenRec;
  28.  
  29. /* forwards */
  30. struct LFOListSpecRec;
  31.  
  32. typedef enum
  33.     {
  34.         eLFOArithAdditive EXECUTE(= -12431),
  35.         eLFOArithGeometric,
  36.         eLFOArithDefault,
  37.         eLFOArithHalfSteps
  38.     } LFOArithSelect;
  39.  
  40. /* flush cached LFO generator records */
  41. void                                FlushLFOGeneratorRecords(void);
  42.  
  43. /* create a new LFO generator based on a list of specifications */
  44. /* it returns the largest pre-origin time for all of the envelopes it contains */
  45. /* AmplitudeScaling and FrequencyScaling are provided primarily for frequency */
  46. /* LFO control; other LFOs are controlled through the accent parameters, and */
  47. /* should supply 1 (no scaling) for these parameters. */
  48. LFOGenRec*                    NewLFOGenerator(struct LFOListSpecRec* LFOListSpec,
  49.                                             long* MaxPreOriginTime, float Accent1, float Accent2,
  50.                                             float Accent3, float Accent4, float FrequencyHertz,
  51.                                             float HurryUp, float TicksPerSecond, float AmplitudeScaling,
  52.                                             float FrequencyScaling, float FreqForMultisampling);
  53.  
  54. /* fix up the origin time so that envelopes start at the proper times */
  55. void                                LFOGeneratorFixEnvelopeOrigins(LFOGenRec* LFOGen,
  56.                                             long ActualPreOriginTime);
  57.  
  58. /* this function computes one LFO cycle and returns the value from the LFO generator. */
  59. /* it should be called on the envelope clock. */
  60. FastFixedType                LFOGenUpdateCycle(LFOGenRec* LFOGen, FastFixedType OriginalValue);
  61.  
  62. /* pass the key-up impulse on to the envelopes contained inside */
  63. void                                LFOGeneratorKeyUpSustain1(LFOGenRec* LFOGen);
  64. void                                LFOGeneratorKeyUpSustain2(LFOGenRec* LFOGen);
  65. void                                LFOGeneratorKeyUpSustain3(LFOGenRec* LFOGen);
  66.  
  67. /* retrigger envelopes from the origin point */
  68. void                                LFOGeneratorRetriggerFromOrigin(LFOGenRec* LFOGen, float Accent1,
  69.                                             float Accent2, float Accent3, float Accent4, float FrequencyHertz,
  70.                                             float HurryUp, float AmplitudeScaling, float FrequencyScaling,
  71.                                             MyBoolean ActuallyRetrigger);
  72.  
  73. /* dispose the LFO generator */
  74. void                                DisposeLFOGenerator(LFOGenRec* LFOGen);
  75.  
  76. /* find out if LFO generator has started yet */
  77. MyBoolean                        HasLFOGeneratorStarted(LFOGenRec* LFOGen);
  78.  
  79. #endif
  80.